Canvg

external class Canvg

SVG renderer on canvas.

Constructors

Link copied to clipboard
constructor(ctx: CanvasRenderingContext2D, svg: Document, options: dynamic = definedExternally)

Main constructor.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun fork(ctx: CanvasRenderingContext2D, svg: String, options: dynamic = definedExternally): Promise<Canvg>

Create new Canvg instance with inherited options.

Link copied to clipboard
fun forkString(ctx: CanvasRenderingContext2D, svg: String, options: dynamic = definedExternally): Canvg

Create new Canvg instance with inherited options.

Link copied to clipboard

Document is ready value.

Link copied to clipboard

Document is ready promise.

Link copied to clipboard
fun render(options: dynamic = definedExternally): Promise<Unit>

Render only first frame, ignoring animations and mouse.

Link copied to clipboard
fun resize(width: Number, height: Number = definedExternally, preserveAspectRatio: Boolean = definedExternally)

Resize SVG to fit in given size.

Link copied to clipboard
fun start(options: dynamic = definedExternally)

Start rendering.

Link copied to clipboard
fun stop()

Stop rendering.